import http from '@/utils/http'
// 订单详情
export const reqOrderInfo = () => {
  return http.get('/order/trade')
}

// 订单地址
export const reqOrderAddress = () => {
  return http.get('/userAddress/getOrderAddress')
}

// 立即购买
export const reqBuyNowGoods = ({ goodsId, ...data }) => {
  return http.get(`/order/buy/${goodsId}`, data)
}

// 提交订单
export const reqSubmitOrder = (data) => {
  return http.post('/order/submitOrder', data)
}

// 微信预支付信息 /webChat/createJsapi/{orderNo}
export const reqPreBuyInfo = (orderNo) => {
  return http.get(`/webChat/createJsapi/${orderNo}`)
}

// 微信支付状态查询
export const reqPayStatus = (orderNo) => {
  return http.get(`/webChat/queryPayStatus/${orderNo}`)
}
// 订单列表
export const reqOrderList = (page, limit) => {
  return http.get(`/order/order/${page}/${limit}`)
}
